import axios from 'axios';
import { message } from "antd";
import axiosFunc from '../utils/Axios'

export default function axiosSendCard(url, options) {
    var f = axiosFunc(url.get, { method: 'get' });
    if (f.rewult === 0) {
        var s = axiosFunc(url.read, { method: 'get' });
        if (s.rewult === 0) {
            var t = axiosFunc(url.postData, { method: 'post', data: options.data });
            if (t.rewult === 0) {
                return { t }
            } else {
                message.error(t.errorcode, t.msg)
            }
        } else {
            message.error(s.errorcode, s.msg)
        }
    } else {
        message.error(f.errorcode, f.msg)
    }
}
